<? 
// Code

// Check if session is not registered , redirect back to main page.
// Put this code in first line of web page.

session_start();
if(empty($_SESSION['username'])){
    header("location:login_page.php");
}else{
    checkSession();
}


 

?>
